package com.ls.blog.utils;

/**
 * @program: myblog
 * @author: lishun
 * @create: 2021-07-08 17:49
 **/

import com.ls.blog.vo.UserInfo;

/**
 * 线程内部的一个类
 */
public class UserThreadLocal {
    private UserThreadLocal() {};

    private static final ThreadLocal<UserInfo> LOCAL = new ThreadLocal<>();

    public static void put(UserInfo userInfo){
        LOCAL.set(userInfo);
    }
    public static UserInfo get(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}
